package com.xhlj.controller;
import com.aliyuncs.exceptions.ClientException;
import com.xhlj.annotation.SystemLog;
import com.xhlj.service.FileService;
import com.xhlj.utils.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("ckeditor")
public class CkEditorController {
    @Resource
    private FileService fileService;
    @SystemLog(title = "论坛模块",content = "论坛图片上传")
    @PostMapping("upload")
    public Result fileUpload(
            MultipartFile file,@RequestParam String fileDes,@RequestParam String folderName)
            throws ClientException {
        Result res=fileService.uploadFile(file,fileDes,folderName);
        //返回保存路径
        return res;
    }
}
